package com.xj0927.springcloud.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @Author: xj0927
 * @Description:
 * @Date Created in 2020-10-28 9:38
 * @Modified By:
 */
@RestController
@Slf4j
public class PaymentController {

    @Resource
    private RestTemplate restTemplate;

    private static final String URL = "http://consul-provider-payment";

    @GetMapping(value = "/consumer/consul")
    public String check(){
        String url = URL + "/payment/consul";
        String result = restTemplate.getForObject(url, String.class);
        return result;
    }
}
